<?php
	include_once 'BaseModel.php';
	include_once 'UserPageDAO.php';
	
	class HeaderModel extends BaseModel {
		public function getData($params) {
			$data->pageOwner = $params->pageOwner;
			$data->user = UserDAO::getInstance()->getUser($params->pageOwner);
			if($data->user!=null)
				if(($userpage = UserPageDAO::getInstance()->getUserPage($data->user->getId())) != null) {
					$data->userPage = $userpage;//UserPageDAO::getInstance()->getUserPage($data->user->getId());
					$data->headerEntries[] = '<link rel="stylesheet" href="'.$data->userPage->getCssUrl().'" />';		
				} else
					$data->userPage=null;
			else
				$data->userPage=null;
			return $data;
		}
	}
?>